<template>
    <div class="box">
        <div class="editResp">
            <van-field
                v-model="resp"
                rows="2"
                autosize
                label=""
                type="textarea"
                maxlength="200"
                placeholder="请输入默认回复内容"
                show-word-limit
            />
        </div>
        <div>
            <van-button round type="info" class="btn" @click="storeResponse">保存</van-button>
        </div>
    </div>
</template>

<script>
    export default{
        data(){
            return{
                resp:''   //默认回复
            }
        },
        methods:{
            storeResponse(){
                // this.$store.reply.commit('editResp',this.resp);   //后端发请求，修改默认回复
                this.$router.push({
                    path:'./StoreNewResponse',
                    query:{
                        resp:this.resp
                    }
                })

            }
            
        },
        created(){
            this.resp=this.$route.query.defaultResponse;

        }
    }
</script>
<style scoped>
    .box{
        text-align: center;
    }
    .editResp{
        width: 90%;
        height: auto;
        margin: 10px auto;
        border: 1px solid grey;
    }
    .btn{
        width: 200px;
        height: 50px;
        margin: 5px auto;
    }
</style>
